<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        IPPI Admin Page
        <small>Coordinator</small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="loading">Loading&#8230;</div>
    <!-- Main row -->
    <div class="row">
        <!-- right col (We are only adding the ID to make the widgets sortable)-->
        <div class="col-md-12">
            <div id="msg" class="alert alert-danger alert-dismissable">
                <i class="fa fa-ban"></i>
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">�</button>
                <b>Alert!</b> Danger alert preview. This alert is dismissable. A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
            </div>
        </div>
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">Coordinator Data Table</h3>                                    
                </div><!-- /.box-header -->
                <div class="box-body table-responsive">
                        <!-- .table - Uses sparkline charts-->
                    <table id="example2" class="table table-striped">
                        <thead>
                            <tr>
                                <th>No &nbsp;</th>
                                <th>Username </th>
                                <th>Name </th>
                                <th>Propinsi </th>
                                <th>Status</th>
                                <th class="text-center">Action </th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        <?php
                        $i=1;
                        foreach($list_data as $r):
                        ?>

                            <tr>
                                <td><?php echo $i++;?></td>
                                <td><?php echo $r->username;?></td>
                                <td><?php echo $r->name;?></td>
                                <td><?php echo $r->state_name;?></td>
                                <td class="text-left">
                                    <?php 
                                    if($r->deleted == 1){
                                        ?>
                                    <span class="text-muted"><i class="fa fa-times-circle"></i>&nbsp;deleted</span>
                                            <?php
                                    }
                                    else{
                                        if($r->status == 0){
                                            ?>
                                    <span class="text-yellow"><i class="fa fa-warning"></i>&nbsp;Banned</span>
                                                <?php
                                        }
                                        elseif($r->status == 1){
                                            ?>
                                        <span class="text-green"><i class="fa fa-check-circle"></i>&nbsp;activate</span>
                                                <?php
                                        }
                                        else{
                                            ?>
                                        <span class="text-light-blue"><i class="fa fa-question-circle"></i>&nbsp;undefined</span>
                                                <?php
                                        }
                                    }
                                    ?>
                                </td>
                                <td class="text-center">
                                    <a class="btn btn-xs btn-info" href="<?php echo site_url()?>admin_coordinator/detail/<?php echo $r->id_admin;?>" title="detail">det</a>
                                <?php
                                if($r->deleted == 1){
                                    ?>
                                    <a href="#" class="restore_coordinator btn btn-xs btn-default" data-id="<?php echo $r->id_admin;?>" title="restore deleted data">res</a>
                                    <a href="#" class="delete_coordinator btn btn-xs btn-warning" data-id="<?php echo $r->id_admin;?>" data-status="<?php echo $r->deleted;?>" title="delete data" >del</a>
                                        <?php
                                }
                                else{
                                    ?>
                                    <a href="#" class="delete_coordinator btn btn-xs btn-warning" data-id="<?php echo $r->id_admin;?>" data-status="<?php echo $r->deleted;?>" title="delete data" >del</a>
                                    <?php
                                    if($r->status == 1){
                                        ?>
                                    <a href="#" class="block_coordinator btn btn-xs btn-danger" data-id="<?php echo $r->id_admin;?>" data-status="<?php echo $r->status;?>" title="block coordinator">blo</a>
                                            <?php
                                    }
                                    else{
                                        ?>
                                    <a href="#" class="unblock_coordinator btn btn-xs btn-danger" data-id="<?php echo $r->id_admin;?>" data-status="<?php echo $r->status;?>" title="unblock coordinator">unb</a>
                                            <?php
                                    }
                                    ?>
                                    
                                        <?php
                                }
                                ?>
                                    
                                </td>
                            </tr>
                        <?php
                        endforeach
                        ?>
                        </tbody>
                    </table><!-- /.table -->
                    <a href="<?php echo site_url()?>admin_coordinator/add" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> &nbsp;Add New Data</a>
                </div>
            </div>
            <!-- Map box -->
            
            <!-- /.box -->
            
            
        </div><!-- right col -->
    </div><!-- /.row (main row) -->
</section><!-- /.content -->